#include <vector>
#include<unordered_set>
using namespace std;
class Solution {
private:
    vector<vector<int>> res;
    void findSubsequencesCore(vector<int>& nums,vector<int>& path,int start) {
        if (path.size() > 1) res.push_back(path);
        if (start >= nums.size()) return;

        unordered_set<int> set_;
        for (int i = start; i < nums.size(); ++i) {
            if (set_.find(nums[i]) != set_.end()) continue;
            set_.insert(nums[i]);
            if (path.size() < 1|| path.back() <= nums[i]) {
                path.push_back(nums[i]);
                findSubsequencesCore(nums, path, i + 1);
                path.pop_back();
            }
        }

    }
public:
    vector<vector<int>> findSubsequences(vector<int>& nums) {
        if (nums.size() < 2)
            return res;
        vector<int> path;
        findSubsequencesCore(nums, path, 0);
        return res;
    }
};